@page "/agents/overview"
@using SDK.Authorization
@attribute [Authorize(Roles = $"{Roles.Administrator}, {Roles.Engineer}, , {Roles.Reviewer}")]

<PageTitle>Agents Overview | AyBorg</PageTitle>

<div class="page-loading-bar">
    <MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="my-0" hidden="@(!_isLoading)" />
</div>

<MudGrid class="pt-1">
    <MudItem xs="4">
        <MudCard Class="rounded-lg">
            <MudCardHeader>
				<MudText Typo="Typo.h6">Agents</MudText>
			</MudCardHeader>
            <MudCardContent>
                <MudText Typo="Typo.h4">@AgentOverviewService.AgentsCount</MudText>
            </MudCardContent>
        </MudCard>
    </MudItem>
    <MudItem xs="4">
        <MudCard Class="rounded-lg">
            <MudCardHeader>
				<MudText Typo="Typo.h6">Active</MudText>
			</MudCardHeader>
            <MudCardContent>
                <MudText Typo="Typo.h4">@AgentOverviewService.ActiveAgentsCount</MudText>
            </MudCardContent>
        </MudCard>
    </MudItem>
    <MudItem xs="4">
        <MudCard Class="rounded-lg">
            <MudCardHeader>
				<MudText Typo="Typo.h6">Idle</MudText>
			</MudCardHeader>
            <MudCardContent>
                <MudText Typo="Typo.h4">@AgentOverviewService.InactiveAgentsCount</MudText>
            </MudCardContent>
        </MudCard>
    </MudItem>
    <MudItem xs="12">
        <MudCard Class="rounded-lg">
            <MudCardHeader>
				<MudText Typo="Typo.h6">Agents</MudText>
			</MudCardHeader>
            <MudCardContent>
                <AgentsTable Agents="@AgentOverviewService.AgentServices" />
            </MudCardContent>
        </MudCard>
    </MudItem>
</MudGrid>
